/*
 * Counter.java
 *
 * Created on 6 de Dezembro de 2007, 9:51
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package utility;

/**
 *
 * @author rafaelbuck
 */
public final class Counter
{

    /** Creates a new instance of Counter */
    public Counter()
    {
        value = 0;
    }

    /** Creates a new instance of Counter */
    public Counter(int val)
    {
        value = val;
    }

    /** Creates a new instance of Counter */
    public Counter(Counter count)
    {
        value = count.value;
    }

    public void add(int add)
    {
        value += add;
    }

    public void add1()
    {
        value++;
    }

    public void substract(int sub)
    {
        value -= sub;
    }

    public void substract1()
    {
        value--;
    }

    public int getValue()
    {
        return value;
    }

    private int value;
}